#include "huiyidialog.h"
#include "ui_huiyidialog.h"

huiyiDialog::huiyiDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::huiyiDialog)
{
    ui->setupUi(this);
    setWindowTitle("视频会议");
}

huiyiDialog::~huiyiDialog()
{
    delete ui;
}

//关闭事件，点右上角叉关闭登录页面
void huiyiDialog::closeEvent(QCloseEvent *event)
{
    if(QMessageBox::question(this,"提示","是否关闭")
            == QMessageBox::Yes )
    {
        Q_EMIT SIG_close();
        event->accept();
    }
    else
    {
        event->ignore();
    }
}

//设置会议页面的名字和头像（头像还没写）
void huiyiDialog::setInfo(QString name, int icon)
{
    ui->lb_name->setText(name);
}

//点击“创建房间”按钮，发送一个信号给kernel
void huiyiDialog::on_pb_create_clicked()
{
    Q_EMIT SIG_createRoom();
}

//点击“加入房间”按钮，发送一个信号给kernel
void huiyiDialog::on_pb_join_clicked()
{
    Q_EMIT SIG_joinRoom();
}
